﻿using FDSimpleModelGenerator.Common.HtmlConvert;
using Microsoft.Extensions.DependencyInjection;

namespace FDSimpleModelGenerator.Common
{
    public static class CommonUsingExtensions
    {
        /// <summary>
        /// 使用公共组件
        /// </summary>
        /// <param name="services"></param>
        /// <returns></returns>
        public static IServiceCollection AddCommon(this IServiceCollection services)
        {
            services.AddSingleton<IExceptionThrowFactory, ExceptionThrowFactory>();
            services.AddSingleton<ICache, DefaultCache>();
            services.AddSingleton<ILanguageSymbolHtml, CSharpSymbolHtml>();
            services.AddSingleton<ILanguageSymbolHtml, JavaSymbolHtml>();
            services.AddSingleton<ILanguageSymbolHtml, SqlSymbolHtml>();
            services.AddSingleton<ILanguageSymbolHtml, JdbcSymbolHtml>();
            return services;
        }
    }
}
